package com.zhuss.controller.product;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zhuss.bean.bo.product.train.CreateTrainBo;
import com.zhuss.bean.bo.product.train.DeleteTrainBo;
import com.zhuss.bean.bo.product.train.UpdateTrainBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.OperateService;
import com.zhuss.product.train.TrainOperateServiceExt;
import com.zhuss.exception.DzcxException;


/**
 * @description: 车次操作的Controller
 * @author: zhushanshuo
 * @create: Mon Jan 04 08:55:12 CST 2021
 **/
@RestController
@RequestMapping("/train")
public class TrainOperateController extends BaseController {
	
	@Autowired
	@Qualifier("trainOperateService")
	private OperateService<Void, Object> trainOperateService;
	
	@Autowired
	@Qualifier("trainOperateServiceExt")
	private TrainOperateServiceExt trainOperateServiceExt;
	
	/**
	 * 创建
	 * @param bo
	 * @throws DzcxException
	 */
	@ResponseBody
    @PostMapping("/create")
    public void create(@RequestBody CreateTrainBo bo) throws DzcxException {
		
		trainOperateService.create(bo);
    }
	
	
	/**
	 * 修改
	 * @param bo
	 * @throws DzcxException
	 */
	@ResponseBody
    @PostMapping("/update")
    public void update(@RequestBody UpdateTrainBo bo) throws DzcxException {
		
		trainOperateService.update(bo);
    }
	
	/**
	 * 删除
	 * @param bo
	 * @throws DzcxException
	 */
	@ResponseBody
    @PostMapping("/delete")
    public void delete(@RequestBody DeleteTrainBo bo) throws DzcxException {
		
		trainOperateService.delete(bo);
    }
	
}
